package com.dianping.cat.consumer.top.model.entity;

import com.dianping.cat.consumer.top.model.BaseEntity;
import com.dianping.cat.consumer.top.model.IVisitor;
import java.util.LinkedHashMap;
import java.util.Map;

























public class Segment
  extends BaseEntity<Segment>
{
  private Integer m_id;
  private long m_error;
  private long m_url;
  private double m_urlDuration;
  private long m_service;
  private double m_serviceDuration;
  private long m_sql;
  private double m_sqlDuration;
  private long m_call;
  private double m_callDuration;
  private long m_cache;
  private double m_cacheDuration;
  private long m_urlError;
  private double m_urlSum;
  private long m_serviceError;
  private double m_serviceSum;
  private long m_sqlError;
  private double m_sqlSum;
  private long m_callError;
  private double m_callSum;
  private long m_cacheError;
  private double m_cacheSum;
/*  57 */   private Map<String, Error> m_errors = new LinkedHashMap();

/*  59 */   private Map<String, Machine> m_machines = new LinkedHashMap();





/*  65 */   public Segment(Integer id) { this.m_id = id; }




/*  70 */   public void accept(IVisitor visitor) { visitor.visitSegment(this); }


  public Segment addError(Error error) {
/*  74 */     this.m_errors.put(error.getId(), error);
/*  75 */     return this;
  }

  public Segment addMachine(Machine machine) {
/*  79 */     this.m_machines.put(machine.getId(), machine);
/*  80 */     return this;
  }


  public boolean equals(Object obj) {
/*  85 */     if (obj instanceof Segment) {
/*  86 */       Segment _o = (Segment)obj;

/*  88 */       if (!equals(getId(), _o.getId())) {
/*  89 */         return false;
      }

/*  92 */       return true;
    }

/*  95 */     return false;
  }


/*  99 */   public Error findError(String id) { return (Error)this.m_errors.get(id); }



/* 103 */   public Machine findMachine(String id) { return (Machine)this.m_machines.get(id); }


  public Error findOrCreateError(String id) {
/* 107 */     Error error = (Error)this.m_errors.get(id);

/* 109 */     if (error == null) {
/* 110 */       synchronized (this.m_errors) {
/* 111 */         error = (Error)this.m_errors.get(id);

/* 113 */         if (error == null) {
/* 114 */           error = new Error(id);
/* 115 */           this.m_errors.put(id, error);
        }
      }
    }

/* 120 */     return error;
  }

  public Machine findOrCreateMachine(String id) {
/* 124 */     Machine machine = (Machine)this.m_machines.get(id);

/* 126 */     if (machine == null) {
/* 127 */       synchronized (this.m_machines) {
/* 128 */         machine = (Machine)this.m_machines.get(id);

/* 130 */         if (machine == null) {
/* 131 */           machine = new Machine(id);
/* 132 */           this.m_machines.put(id, machine);
        }
      }
    }

/* 137 */     return machine;
  }


/* 141 */   public long getCache() { return this.m_cache; }



/* 145 */   public double getCacheDuration() { return this.m_cacheDuration; }



/* 149 */   public long getCacheError() { return this.m_cacheError; }



/* 153 */   public double getCacheSum() { return this.m_cacheSum; }



/* 157 */   public long getCall() { return this.m_call; }



/* 161 */   public double getCallDuration() { return this.m_callDuration; }



/* 165 */   public long getCallError() { return this.m_callError; }



/* 169 */   public double getCallSum() { return this.m_callSum; }



/* 173 */   public long getError() { return this.m_error; }



/* 177 */   public Map<String, Error> getErrors() { return this.m_errors; }



/* 181 */   public Integer getId() { return this.m_id; }



/* 185 */   public Map<String, Machine> getMachines() { return this.m_machines; }



/* 189 */   public long getService() { return this.m_service; }



/* 193 */   public double getServiceDuration() { return this.m_serviceDuration; }



/* 197 */   public long getServiceError() { return this.m_serviceError; }



/* 201 */   public double getServiceSum() { return this.m_serviceSum; }



/* 205 */   public long getSql() { return this.m_sql; }



/* 209 */   public double getSqlDuration() { return this.m_sqlDuration; }



/* 213 */   public long getSqlError() { return this.m_sqlError; }



/* 217 */   public double getSqlSum() { return this.m_sqlSum; }



/* 221 */   public long getUrl() { return this.m_url; }



/* 225 */   public double getUrlDuration() { return this.m_urlDuration; }



/* 229 */   public long getUrlError() { return this.m_urlError; }



/* 233 */   public double getUrlSum() { return this.m_urlSum; }





  public Segment incError() {
/* 246 */     this.m_error++;
/* 247 */     return this;
  }

  public Segment incError(long error) {
/* 251 */     this.m_error += error;
/* 252 */     return this;
  }


  public void mergeAttributes(Segment other) {
/* 257 */     assertAttributeEquals(other, "segment", "id", this.m_id, other.getId());

/* 259 */     this.m_error = other.getError();

/* 261 */     this.m_url = other.getUrl();

/* 263 */     this.m_urlDuration = other.getUrlDuration();

/* 265 */     this.m_service = other.getService();

/* 267 */     this.m_serviceDuration = other.getServiceDuration();

/* 269 */     this.m_sql = other.getSql();

/* 271 */     this.m_sqlDuration = other.getSqlDuration();

/* 273 */     this.m_call = other.getCall();

/* 275 */     this.m_callDuration = other.getCallDuration();

/* 277 */     this.m_cache = other.getCache();

/* 279 */     this.m_cacheDuration = other.getCacheDuration();

/* 281 */     this.m_urlError = other.getUrlError();

/* 283 */     this.m_urlSum = other.getUrlSum();

/* 285 */     this.m_serviceError = other.getServiceError();

/* 287 */     this.m_serviceSum = other.getServiceSum();

/* 289 */     this.m_sqlError = other.getSqlError();

/* 291 */     this.m_sqlSum = other.getSqlSum();

/* 293 */     this.m_callError = other.getCallError();

/* 295 */     this.m_callSum = other.getCallSum();

/* 297 */     this.m_cacheError = other.getCacheError();

/* 299 */     this.m_cacheSum = other.getCacheSum();
  }


/* 303 */   public Error removeError(String id) { return (Error)this.m_errors.remove(id); }



/* 307 */   public Machine removeMachine(String id) { return (Machine)this.m_machines.remove(id); }


  public Segment setCache(long cache) {
/* 311 */     this.m_cache = cache;
/* 312 */     return this;
  }

  public Segment setCacheDuration(double cacheDuration) {
/* 316 */     this.m_cacheDuration = cacheDuration;
/* 317 */     return this;
  }

  public Segment setCacheError(long cacheError) {
/* 321 */     this.m_cacheError = cacheError;
/* 322 */     return this;
  }

  public Segment setCacheSum(double cacheSum) {
/* 326 */     this.m_cacheSum = cacheSum;
/* 327 */     return this;
  }

  public Segment setCall(long call) {
/* 331 */     this.m_call = call;
/* 332 */     return this;
  }

  public Segment setCallDuration(double callDuration) {
/* 336 */     this.m_callDuration = callDuration;
/* 337 */     return this;
  }

  public Segment setCallError(long callError) {
/* 341 */     this.m_callError = callError;
/* 342 */     return this;
  }

  public Segment setCallSum(double callSum) {
/* 346 */     this.m_callSum = callSum;
/* 347 */     return this;
  }

  public Segment setError(long error) {
/* 351 */     this.m_error = error;
/* 352 */     return this;
  }

  public Segment setId(Integer id) {
/* 356 */     this.m_id = id;
/* 357 */     return this;
  }

  public Segment setService(long service) {
/* 361 */     this.m_service = service;
/* 362 */     return this;
  }

  public Segment setServiceDuration(double serviceDuration) {
/* 366 */     this.m_serviceDuration = serviceDuration;
/* 367 */     return this;
  }

  public Segment setServiceError(long serviceError) {
/* 371 */     this.m_serviceError = serviceError;
/* 372 */     return this;
  }

  public Segment setServiceSum(double serviceSum) {
/* 376 */     this.m_serviceSum = serviceSum;
/* 377 */     return this;
  }

  public Segment setSql(long sql) {
/* 381 */     this.m_sql = sql;
/* 382 */     return this;
  }

  public Segment setSqlDuration(double sqlDuration) {
/* 386 */     this.m_sqlDuration = sqlDuration;
/* 387 */     return this;
  }

  public Segment setSqlError(long sqlError) {
/* 391 */     this.m_sqlError = sqlError;
/* 392 */     return this;
  }

  public Segment setSqlSum(double sqlSum) {
/* 396 */     this.m_sqlSum = sqlSum;
/* 397 */     return this;
  }

  public Segment setUrl(long url) {
/* 401 */     this.m_url = url;
/* 402 */     return this;
  }

  public Segment setUrlDuration(double urlDuration) {
/* 406 */     this.m_urlDuration = urlDuration;
/* 407 */     return this;
  }

  public Segment setUrlError(long urlError) {
/* 411 */     this.m_urlError = urlError;
/* 412 */     return this;
  }

  public Segment setUrlSum(double urlSum) {
/* 416 */     this.m_urlSum = urlSum;
/* 417 */     return this;
  }

  public Segment() {}
}


/* Location:              /Users/hanfei/Documents/apache-tomcat-9.0.24/webapps/cat/WEB-INF/lib/cat-consumer-3.0.0.jar!/com/dianping/cat/consumer/top/model/entity/Segment.class
 * Java compiler version: 7 (51.0)
 * JD-Core Version:       1.0.7
 */